package com.molichuxing.services.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;


@Component
public class IovPropertyUtils {
    private static Logger logger = LoggerFactory.getLogger(IovPropertyUtils.class);

    private static String URL;

    //权限
    public static String GET_TOKEN_URL; //获取token接口
    public static String CREATE_ACCOUNT_URL; //添加用户接口
    public static String MODIFY_ACCOUNT_URL; //编辑用户接口
    public static String MODIFY_PASSWORD_URL; //修改密码接口
    public static String GET_ACCOUNT_GROUP_URL; //获取用户绑定角色
    public static String GET_GROUP_PAGE_LIST_URL; //通过分页获取角色
    public static String GET_GROUP_COUNT_URL; //获得车联网角色数量
    public static String GET_GROUP_PERMISSION_URL; //获得车联网角色绑定权限列表
    public static String CREATE_GROUP_URL; //创建角色
    public static String MODIFY_GROUP_URL; //修改角色
    public static String SET_PERMISSION_URL; //添加权限
    public static String GET_GROUP_LIST; //获取角色列表
    public static String GET_USER_LIST; //获取用户列表

    //车辆
    public static String GET_MILEAGE_BY_VIN; //通过车架号获取里程
    public static String GET_SOC_BY_VIN; //通过车架号获取电量
    public static String GET_TRAJECTORY_BY_VIN_TIME; //通过车架号获取行驶轨迹的时间段
    public static String GET_TRAJECTORY_BY_VIN; //通过车架号获取行驶轨迹
    public static String OFFLINE_ALARMS_BY_VIM; //失联车辆报警
    public static String GET_MILEAGE; //获取里程
    public static String MILEAGE_EX_ALARMS; // 未处理里程异变
    public static String COMMAND_CONTROL; // 控车
    public static String DYNAMIC_STATE; // 查询车辆动力状态
    public static String VEHICLE_ISAUTH; // 车辆取消授权
    public static String CAR_OFFLINE_CONFIG; // 车辆失联
    public static String CAR_OFFLINE_CONFIG_MODIFY; // 车辆失联修改

    //围栏
    public static String FENCE_ADD;//围栏添加
    public static String FENCE_MODIFY;//围栏修改
    public static String FENCE_DELETE;//围栏删除
    public static String FENCE_BINDING;//围栏绑定
    public static String FENCE_BINDING_DELETE;//围栏解绑
    public static String FENCE_BINDING_DELETE_ALL;//围栏解绑全部
    public static String FENCE_IS_INSIDE; //指定车辆是否在围栏接口
    public static String FENCE_LIST;//围栏列表
    public static String FENCE_IS_BINDING_VEHICLE;//围栏是否绑定车
    public static String FENCE_BY_ID;//根据id获取围栏信息
    public static String FENCE_BY_VEHICLE;//根据vin获取车辆所在的围栏
    public static String FENCE_VAGUE_BY_VEHICLE;//根据围栏名称模糊搜索围栏信息
    public static String FENCE_IS_INSIDES; //指定车辆是否在围栏接口
    /**
     * 围栏报警接口
     */
    public static String LIST_FENCE_ALARMS;


    @Value("${iov.permission.url}")
    public void setUrl(String url) {
        IovPropertyUtils.URL = url;
        IovPropertyUtils.GET_TOKEN_URL = URL + "/token"; //获取token接口
        IovPropertyUtils.CREATE_ACCOUNT_URL = URL + "/user/saveUser"; //添加用户接口
        IovPropertyUtils.MODIFY_ACCOUNT_URL = URL + "/user/update"; //编辑用户接口
        IovPropertyUtils.MODIFY_PASSWORD_URL = URL + "/user/updatePwd"; //修改密码接口
        IovPropertyUtils.GET_ACCOUNT_GROUP_URL = URL + "/user/getUserRoleByAccount"; //获取用户绑定角色
        IovPropertyUtils.GET_GROUP_PAGE_LIST_URL = URL + "/role/listRoleOfPage"; //通过分页获取角色
        IovPropertyUtils.GET_GROUP_COUNT_URL = URL + "/role/getRoleCount"; //获得车联网角色数量
        IovPropertyUtils.GET_GROUP_PERMISSION_URL = URL + "/role/getRolePermissions"; //获得车联网角色绑定权限列表
        IovPropertyUtils.CREATE_GROUP_URL = URL + "/role/saveRole"; //创建角色
        IovPropertyUtils.MODIFY_GROUP_URL = URL + "/role/update"; //修改角色
        IovPropertyUtils.SET_PERMISSION_URL = URL + "/role/setPermission"; //添加权限
        IovPropertyUtils.GET_GROUP_LIST = URL + "/role/listRole"; //获取角色列表
        IovPropertyUtils.GET_USER_LIST = URL + "/user/list"; //获取用户列表

        IovPropertyUtils.GET_SOC_BY_VIN = URL + "/real/soc/map"; //通过车架号获取电量
        IovPropertyUtils.GET_MILEAGE_BY_VIN = URL + "/real/list"; //通过车架号获取里程
        IovPropertyUtils.GET_TRAJECTORY_BY_VIN_TIME = URL + "/his/trajectory"; //通过车架号获取里程时间段
        IovPropertyUtils.GET_TRAJECTORY_BY_VIN = URL + "/his/track"; //通过车架号获取里程
        IovPropertyUtils.OFFLINE_ALARMS_BY_VIM = URL + "/alarm/listOfflineAlarms"; //失联车辆报警
        IovPropertyUtils.GET_MILEAGE = URL + "/real/all"; //获取里程
        IovPropertyUtils.MILEAGE_EX_ALARMS = URL + "/alarm/listMileageExAlarms"; // 未处理里程异变
        IovPropertyUtils.COMMAND_CONTROL = URL + "/command/control"; // 控车
        IovPropertyUtils.DYNAMIC_STATE = URL + "/real/dynamicState/map"; // 查询车辆动力状态
        IovPropertyUtils.VEHICLE_ISAUTH = URL + "/api/vehicle/isAuth"; // 车辆取消授权
        IovPropertyUtils.CAR_OFFLINE_CONFIG = URL + "/sys/sysParamSettings/list"; // 车辆失联
        IovPropertyUtils.CAR_OFFLINE_CONFIG_MODIFY = URL + "/sys/sysParamSettings/update"; // 车辆失联修改

        IovPropertyUtils.FENCE_ADD = URL + "/api/vehicleFence/save"; //围栏添加
        IovPropertyUtils.FENCE_MODIFY = URL + "/api/vehicleFence/update"; //围栏修改
        IovPropertyUtils.FENCE_DELETE = URL + "/api/vehicleFence/delete"; //围栏删除
        IovPropertyUtils.FENCE_BINDING = URL + "/api/vehicleBinding/save"; //围栏绑定
        IovPropertyUtils.FENCE_BINDING_DELETE = URL + "/api/vehicleBinding/delete"; //围栏解绑
        IovPropertyUtils.FENCE_BINDING_DELETE_ALL = URL + "/api/vehicleBinding/deleteAll"; //围栏解绑全部
        IovPropertyUtils.FENCE_IS_INSIDE = URL + "/api/vehicleBinding/isInside"; //指定车辆是否在围栏接口
        IovPropertyUtils.FENCE_LIST = URL + "/api/vehicleFence/list"; //围栏列表接口
        IovPropertyUtils.FENCE_IS_BINDING_VEHICLE = URL + "/api/vehicleFence/isBindingVehicleByFenceId"; //围栏是否绑定车接口
        IovPropertyUtils.FENCE_BY_ID = URL + "/api/vehicleFence/getVehicleFenceById"; //根据id获取围栏信息
        IovPropertyUtils.FENCE_BY_VEHICLE = URL + "/api/vehicleFence/listByVinList"; //根据vin获取车辆所在的围栏
        IovPropertyUtils.FENCE_VAGUE_BY_VEHICLE = URL + "/api/vehicleFence/listByFenceName"; //根据围栏名称模糊搜索围栏信息
        IovPropertyUtils.FENCE_IS_INSIDES = URL + "/api/vehicleBinding/isInsides"; //指定车辆是否在围栏接口
        /**
         * 围栏报警接口
         */
        IovPropertyUtils.LIST_FENCE_ALARMS = URL + "/alarm/listFenceAlarms";

    }
}
